<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>挂接</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="../css/font.css">
        <link rel="stylesheet" href="../css/xadmin.css">
        <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="../js/xadmin.js"></script>
        <script src="../lib/axios.min.js"></script>
        <script src="../lib/xlsx.mini.min.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="layui-upload">
            <div class="layui-row">
                <img src="../images/QQ图片20200310151730.jpg" style="display: inline-block; width: 200px;">
                <img src="../images/QQ图片20200310151730.jpg" style="display: inline-block; width: 200px;">
            </div>
            <div class="layui-row">
                <div class="layui-upload-drag" id="uplo">
                    <i class="layui-icon">&#xe681;</i>
                    <p>点击上传，或将文件拖拽到此处</p>
                    <div class="layui-hide" id="uploadDemoView">
                      <hr>
                      <img src="" alt="上传成功后渲染" style="width: 140px; height: 140px;">
                    </div>
                </div>
            </div>
          </div>

        <script>
            layui.use('upload', function(){
                var $ = layui.jquery
                ,upload = layui.upload;
                 //拖拽上传
                upload.render({
                    elem: '#uplo'
                    ,url: 'https://httpbin.org/post' //改成您自己的上传接口
                    ,done: function(res){
                    layer.msg('上传成功');
                    layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
                    console.log(res)
                    }
                });
                
            })
        </script>
    </body>

</html>